package com.chiry.buyer.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author fyx
 * @version 1.0
 * @date 2021/12/14 17:06
 * @description : 跨域配置
 */
@Configuration
public class WebMVCConfig implements WebMvcConfigurer {
    @Value("http://localhost:10000")
    public  String buyerUrl;
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**").allowedOrigins(buyerUrl);
    }
}
